package com.itheima.controller;

import com.itheima.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/jsonparam")
@ResponseBody
public class ParamJsonController {
    @RequestMapping("/json1")
    public String json1(@RequestBody List<String> list){
        System.out.println(list);
        return "{'info' : 'Json hellow'}";
    }

    @RequestMapping("/json2")
    public String json2(@RequestBody User user){
        System.out.println(user);
        return "{'info' : 'Json hellow'}";
    }

    @RequestMapping("/json3")
    public String json(@RequestBody List<User> list){
        System.out.println(list);
        return "{'info' : 'Json hellow'}";
    }


}
